package com.hissy.common.serializer;

import java.math.BigDecimal;

import com.caucho.hessian.io.*;

public class HessionBigDecimalSerializerFactory extends AbstractSerializerFactory {

    private static final StringValueSerializer bigDecimalSerializer=new StringValueSerializer();

    private static final BigDecimalDeserializer bigDecimalDeserializer=new BigDecimalDeserializer();

    @Override
    public com.caucho.hessian.io.Serializer getSerializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
        if(BigDecimal.class.isAssignableFrom(cl)) {
            return bigDecimalSerializer;
        }
        return null;
    }

    @Override
    public Deserializer getDeserializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
        if(BigDecimal.class.isAssignableFrom(cl)) {
            return bigDecimalDeserializer;
        }
        return null;
    }

}
